package com.sjcq.demoexample.config.quartz;

import com.sjcq.demoexample.mapper.SysLogMapper;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.quartz.QuartzJobBean;


public class QuartzJob extends QuartzJobBean {
    @Autowired
    private SysLogMapper sysLogMapper;

    @Override
    protected void executeInternal(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        System.out.println("我要删除日志了--每天24点删除前一天的日志删除");

        // 每天0点删除前一天的日志

        int i = sysLogMapper.delSysLogByDate();
        System.out.println("本次一共删除了:"+i+"条日志!");
    }

}
